home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / bluez-utils.postinst < prev    next >
Encoding:
Text File  |  2007-03-30  |  2.0 KB  |  70 lines

  1. #!/bin/sh
  2.  
  3. # Move a conffile without triggering a dpkg question
  4. mv_conffile() {
  5.     OLDCONFFILE="$1"
  6.     NEWCONFFILE="$2"
  7.  
  8.     if [ -e "$OLDCONFFILE" ]; then
  9.         echo "Preserving user changes to $NEWCONFFILE ..."
  10.         mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
  11.         mv -f "$OLDCONFFILE" "$NEWCONFFILE"
  12.     fi
  13. }
  14.  
  15. set -e
  16. case "$1" in
  17.     configure)
  18.         # remove bluez-sdpd init, if present
  19.         if [ -f /etc/init.d/bluez-sdp ]; then
  20.             /usr/sbin/update-rc.d -f bluez-sdp remove
  21.             echo "To stop seeing this, remove the now redundant /etc/init.d/bluez-sdp script."
  22.         fi
  23.  
  24.         if [ -e /etc/init.d/bluez-utils ]; then
  25.             /usr/sbin/update-rc.d -f bluez-utils remove
  26.             # maybe a (medium/low debconf?) notice is best suited here
  27.         fi
  28.        
  29.         mv_conffile "/etc/init.d/bluez-utils" "/etc/init.d/bluetooth"
  30.         mv_conffile "/etc/default/bluez-utils" "/etc/default/bluetooth"
  31.         
  32.  
  33.         # update modules.conf
  34.         /sbin/update-modules >/dev/null 2>&1
  35.  
  36.     # Remove shutdown and reboot links; this init script does not need them.
  37.     if dpkg --compare-versions "$2" lt "3.1-1ubuntu2"; then
  38.         rm -f /etc/rc0.d/K74bluetooth /etc/rc6.d/K74bluetooth
  39.     fi
  40.  
  41.         # use MAKEDEV instead of the original bluez script below as per policy 10.6
  42.         if [ -x /dev/MAKEDEV ]; then
  43.             echo "Creating device nodes ..."
  44.             cd /dev && ./MAKEDEV bluetooth
  45.         fi
  46.         
  47. #        if [ -r /etc/bluetooth/pin ]; then
  48. #            echo "Converting default outgoing PIN to default passkey:"
  49. #            cp -v /etc/bluetooth/pin /etc/bluetooth/passkeys/default
  50. #        fi
  51.         ;;
  52.  
  53.     *)
  54.         echo "postinst called with unknown argument \`$1'" >&2
  55.         exit 0
  56.     ;;
  57. esac
  58.  
  59. # Automatically added by dh_installinit
  60. if [ -x "/etc/init.d/bluetooth" ]; then
  61.     update-rc.d bluetooth start 25 2 3 4 5 . stop 74 1 . >/dev/null
  62.     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
  63.         invoke-rc.d bluetooth start || exit $?
  64.     else
  65.         /etc/init.d/bluetooth start || exit $?
  66.     fi
  67. fi
  68. # End automatically added section
  69.  
  70.